import instance from '@/request/request'

/**
 * 添加通知
 * @param data
 * @returns {*}
 * @constructor
 */
export const AddNoticeApi = (data) => {
  return instance({
    url: `/api/notice/addNotice`,
    method: 'post',
    data
  })
}
/**
 * 分页查询信息
 * @param param
 * @returns {*}
 * @constructor
 */
export  const GetNoticePageApi=(param)=>{
  return instance({
    url:`/api/notice/page`,
    method:'get',
    params:param
  })
}
/**
 * 根据id查询信息
 * @param id
 * @returns {Promise<AxiosResponse<any>> | *}
 * @constructor
 */
export const GetNoticeByIdApi=(id)=>{
  return instance({
    url:`/api/notice/${id}`,
    method:'get'
  })
}
/**
 * 删除通知
 * @param ids
 * @returns {*}
 * @constructor
 */
export const DeleteNoticeApi=(ids)=>{
  return instance({
    url:`/api/notice/delete`,
    method:'delete',
    params:{ids}
  })
}
/**
 * 分页查询信息
 * @param param
 * @returns {*}
 * @constructor
 */
export  const GetUserNoticeApi=(param)=>{
  return instance({
    url:`/api/notice/pageUserNotice`,
    method:'get',
    params:param
  })
}
/**
 * 修改通知
 * @param data
 * @returns {Promise<AxiosResponse<any>> | *}
 * @constructor
 */
export const UpdateNoticeApi=(data)=>{
  return instance({
    url: `/api/notice/update`,
    method:'put',
    data
  })
}
